account = 1000
buycar = []
shopinventory = ['噬神者之书','破军','红莲斗篷','霸者重装','极影','痛苦面具']
'''
噬神者之书200元:a
破军400元:b
红莲斗篷392元:c
霸者重装234元:d
极影244元:e
痛苦面具231元:f
'''
a = 200
b = 400
c = 392
d = 234
e = 244
f = 231

while account > 0 :
    buyfront = str(input("你要买什么："))
    exist = buyfront in shopinventory
    if exist :
        print("买了")
        buycar.append(buyfront)
        if buyfront == '噬神者之书':
            account -= a
            if account < 0:
                print("钱不够了")
                break
            else:
                print("卡里还有：",account)
                print("你还买吗，买的话进行下一步")
        elif buyfront == '破军':
            account -= b
            if account < 0:
                print("钱不够了")
                break
            else:
                print("卡里还有：",account)
                print("你还买吗，买的话进行下一步")
        elif buyfront == '红莲斗篷':
            account -= c
            if account < 0:
                print("钱不够了")
                break
            else:
                print("卡里还有：", account)
                print("你还买吗，买的话进行下一步")
        elif buyfront == '霸者重装':
            account -= d
            if account < 0:
                print("钱不够了")
                break
            else:
                print("卡里还有：", account)
                print("你还买吗，买的话进行下一步")
        elif buyfront == '极影':
            account -= e
            if account < 0:
                print("钱不够了")
                break
            else:
                print("卡里还有：", account)
                print("你还买吗，买的话进行下一步")
        elif buyfront == '痛苦面具':
            account -= f
            if account < 0:
                print("钱不够了")
                break
            else:
                print("卡里还有：", account)
                print("你还买吗，买的话进行下一步")
    else:
        print("没有")
        break
if buycar == [] :
    print("没买东西")
else:
    print("购物车里有：",buycar)

